package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PropertyCompanyMapper;
import com.ruoyi.system.domain.PropertyCompany;
import com.ruoyi.system.service.IPropertyCompanyService;

/**
 * 物业主体信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-27
 */
@Service
public class PropertyCompanyServiceImpl implements IPropertyCompanyService 
{
    @Autowired
    private PropertyCompanyMapper propertyCompanyMapper;

    /**
     * 查询物业主体信息
     * 
     * @param companyId 物业主体信息主键
     * @return 物业主体信息
     */
    @Override
    public PropertyCompany selectPropertyCompanyByCompanyId(Long companyId)
    {
        return propertyCompanyMapper.selectPropertyCompanyByCompanyId(companyId);
    }

    /**
     * 查询物业主体信息列表
     * 
     * @param propertyCompany 物业主体信息
     * @return 物业主体信息
     */
    @Override
    public List<PropertyCompany> selectPropertyCompanyList(PropertyCompany propertyCompany)
    {
        return propertyCompanyMapper.selectPropertyCompanyList(propertyCompany);
    }

    /**
     * 新增物业主体信息
     * 
     * @param propertyCompany 物业主体信息
     * @return 结果
     */
    @Override
    public int insertPropertyCompany(PropertyCompany propertyCompany)
    {
        propertyCompany.setCreateTime(DateUtils.getNowDate());
        return propertyCompanyMapper.insertPropertyCompany(propertyCompany);
    }

    /**
     * 修改物业主体信息
     * 
     * @param propertyCompany 物业主体信息
     * @return 结果
     */
    @Override
    public int updatePropertyCompany(PropertyCompany propertyCompany)
    {
        propertyCompany.setUpdateTime(DateUtils.getNowDate());
        return propertyCompanyMapper.updatePropertyCompany(propertyCompany);
    }

    /**
     * 批量删除物业主体信息
     * 
     * @param companyIds 需要删除的物业主体信息主键
     * @return 结果
     */
    @Override
    public int deletePropertyCompanyByCompanyIds(Long[] companyIds)
    {
        return propertyCompanyMapper.deletePropertyCompanyByCompanyIds(companyIds);
    }

    /**
     * 删除物业主体信息信息
     * 
     * @param companyId 物业主体信息主键
     * @return 结果
     */
    @Override
    public int deletePropertyCompanyByCompanyId(Long companyId)
    {
        return propertyCompanyMapper.deletePropertyCompanyByCompanyId(companyId);
    }
}
